package com.letv.core.api;

public class LetvHttpApiConfig {

    /**
     * 渠道号
     * */
    public static String PCODE;

    /**
     * 当前版本
     * */
    public static String VERSION;

    /**
     * 初始化化pcode 和 version
     * 
     * @param pcode
     * 渠道号
     * @param version
     * app版本
     * */
    public static void initialize(String pcode, String version) {
        PCODE = pcode;
        VERSION = version;
    }

    /**
     * 获取公共静态尾
     * 
     * @return
     */
    public static String getStaticEnd() {
        return STATIC_APP_BASE_END;
    }

    /**
     * 公共参数
     * */
    public interface PUBLIC_PARAMETERS {
        String MOD_KEY = "mod";
        String CTL_KEY = "ctl";
        String ACT_KEY = "act";
        String MARKID_KEY = "markid";
        String PCODE_KEY = "pcode";
        String VERSION_KEY = "version";
        String CT_KEY = "ct";
        String ID_KEY = "id";
        String LUAMOD_KEY = "luamod";
        String DEVID_KEY = "devid";
    }

    /**
     * 静态请求end
     * */
    private static final String STATIC_APP_BASE_END = ".mindex.html";

    /**
     * 正式接口
     */
    public interface OFFICIAL_URL {
        /***
         * 直播大厅
         */
        String DYNAMIC_APP_LIVE_URL = "http://dynamic.live.app.m.letv.com/android/dynamic.php";

        String DYNAMIC_APP_USERURL = "http://dynamic.user.app.m.letv.com/android/dynamic.php";// 升级下载APP送会员
        /**
         * 动态请求BaseUrl
         * */
        String DYNAMIC_APP_BASE_URL = "http://dynamic.app.m.letv.com/android/dynamic.php";

        /**
         * 静态请求head
         * */
        String STATIC_APP_BASE_HEAD = "http://static.app.m.letv.com/android";

        /**
         * 个性化推荐静态请求head
         * */
        String RECOMMEND_APP_BASE_HEAD = "http://recommend.app.m.letv.com/android";// (version>=5.2.2)

        /**
         * 正式推送接口
         * */
        String APP_PUSH_BASE_URL = "http://msg.m.letv.com/android/index.php";
        // http://msg.m.letv.com/android/index.php?mod=minfo&ctl=pushmsg&act=index&id={$id}&dev_id={$dev_id}&id={$msgid}&pcode={$pcode}&version={$version

        /**
         * 热点正式接口
         * */
        String STATIC_APP_HOT_HEAD = "http://static.meizi.app.m.letv.com/android";

        /**
         * 联通wo流量正式接口
         * */
        String STATIC_APP_WO_BASE_URL = "http://api.";
        
        /**
         * 接口合并请求正式Url
         */
        String COMBINE_APP_URL_NORMAL = "http://api.mob.app.letv.com/";
    }

    /**
     * 测试接口
     */
    public interface TEST_URL {
        /**
         * 动态请求BaseUrl
         * */
        String DYNAMIC_TEST_BASE_URL = "http://test2.m.letv.com/android/dynamic.php";

        /**
         * 静态请求head
         * */
        String STATIC_TEST_BASE_HEAD = "http://test2.m.letv.com/android";

        /**
         * 测试推送接口
         * */
        // public final String PUSH_TEST_BASE_URL = "http://test2.m.letv.com/android/index.php";
        String PUSH_TEST_BASE_URL = "http://test.push.platform.letv.com/android/index.php";

        /**
         * 联通wo流量测试
         * */
        String WO_TEST_BASE_URL = "http://test.push.";
        
        /**
         * 测试和审核,接口合并请求测试Url
         */
        String COMBINE_APP_URL_TEST = "http://api.mob.app.letv.com/";
    }
    
    /**
	 * 请求首页底部精品数据
	 */
    public interface HOME_BOTTOM_PRECOMMEND_PARAMTERS {
		String MOD_VALUE = "mob";
		String CTL_VALUE = "exchange";
		String ACT_VALUE = "bottom";
	}
    
    /**
	 * TV推广控制接口
	 * */
    public interface SPREAD_PARAMETERS {
		String MOD_VALUE = "mob";
		String CTL_VALUE = "spread";
		String ACT_VALUE = "index";
	}
    
    /**
	 * 请求精品应用 /mod/mob/ctl/exchange/act/index
	 */
	public interface RECOMM_PARAMETERS {
		String MOD_VALUE = "mob";
		String CTL_VALUE = "exchange";
		String ACT_VALUE = "index";

		String EXCHID_KEY = "exchid";
		String PAGE_KEY = "page";
		String PAGESIZE_KEY = "pagesize";
		String MARKID_KEY = "markid";
		String PCODE_KEY = "pcode";
		String VERSION_KEY = "version";
	}
	
	/**
     * 请求视频详情参数
     */
    public interface VIDEO_INFO_PARAMETERS {
        String MOD_VALUE = "mob";
        String CTL_VALUE = "video";
        String ACT_VALUE = "detail";

        String ID_KEY = "id";
    }
    
    /**
     * 请求专辑视频列表参数
     */
    public interface VIDEOS_LIST_PARAMETERS {
        String MOD_VALUE = "mob";
        String CTL_VALUE = "videolist";
        String ACT_VALUE = "detail";

        String ID_KEY = "id";// 专辑id
        String VID_KEY = "vid";// 视频id
        // 若使用此参数，则只返回当前vid所在页数的数据，已经所在页码和索引位置，不使用请不要传此参数
        String B_KEY = "b";// 页数--默认为1
        String S_KEY = "s";// 每页数量--默认为30
        String O_KEY = "o";// 排序方式--1:按着集数升序; 1:按着集数降序.默认为:-1
        String M_KEY = "m";// 合并输出--1:合并;
        // 0:不合并.默认为:1合并videoinfo，yugaopininfo，huaxuinfo，zixuninfo，otherinfo
        // 这些视频列表，统一在videoinfo中输出
    }

    /**
     * 海外IP地址
     * */
    // public static final String IP_BASE_URL = "http://hot.vrs.letv.com/ip";
    public static final String IP_BASE_URL = "http://api.letv.com/getipgeo";

    /**
     * QQ登陆的地址
     * @return
     */
    public static String getQQLoginUrl() {
        return "http://dynamic.app.m.letv.com/android/dynamic.php?mod=passport&ctl=index&act=appqq&pcode="
                + LetvHttpApiConfig.PCODE + "&version=" + LetvHttpApiConfig.VERSION;
    }
    
    public static String getSinaLoginUrl() {
        return "http://dynamic.app.m.letv.com/android/dynamic.php?mod=passport&ctl=index&act=appsina&pcode=" + LetvHttpApiConfig.PCODE
                + "&version=" + LetvHttpApiConfig.VERSION;
    }
}
